home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
xlib
/
xlib06
/
xprintf.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-09-12
|
803b
|
42 lines
#include <stdarg.h>
#include <string.h>
#include "xlib.h"
#include "xrect.h"
#include "xtext.h"
extern unsigned char CharWidth;
extern unsigned char CharHeight;
void x_printf(WORD x, WORD y,WORD ScrnOffs,WORD color,char *ln,...){
char dlin[100],*dl=dlin;
char ch;
va_list ap;
va_start(ap,ln);
vsprintf(dlin,ln,ap);
va_end(ap);
while(*dl){
x+=x_char_put(*dl++,x,y,ScrnOffs,color);
}
}
void x_bgprintf(WORD x, WORD y,WORD ScrnOffs,WORD fgcolor,
WORD bgcolor, char *ln,...){
char dlin[100],*dl=dlin;
char ch;
va_list ap;
va_start(ap,ln);
vsprintf(dlin,ln,ap);
va_end(ap);
while(*dl){
x_rect_fill(x,y,x+x_get_char_width(*dl),y+CharHeight,ScrnOffs,bgcolor);
x+=x_char_put(*dl++,x,y,ScrnOffs,fgcolor);
}
}